<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>border-transparent</title>
    <style type="text/css">
        div{
            width: 40px;
            height: 40px;
            padding: 30px;
            border-style:solid;
            border-width: 5px;
            border-color: transparent;
        }
        div:hover{border-color: #f00}
    </style>
</head>
<body>
<div>透明边框</div>
</body>
</html>